<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    #x {
        width: 50px;
    }

    #y {
        width: 50px;
    }

    #sum {
        width: 50px;
    }

    #container {
        height: 100px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #sum {
        width: 50px;
        height: 20px;
        border: 1px solid;
    }
</style>

<body>
    <form id="container">
        <input type="text" id="x" value="">
        +
        <input type="text" id="y" value="">
        <button id="result">=</button>
        <div id="sum"></div>
    </form>
    <script>
        var sum = document.getElementById("sum");
        var result = document.getElementById("result");
        result.onclick = function() {
            var y = document.getElementById("y").value;
            var x = document.getElementById("x").value;
            sum.innerHTML= Number(x) + Number(y);
        }
    </script>
</body>

</html>